Update WindowsUpdate resource to set _restartRequired#1359
Merged
SteveL-MSFT merged 7 commits intoPowerShell:mainfrom Jan 22, 2026
Merged
Update WindowsUpdate resource to set _restartRequired#1359SteveL-MSFT merged 7 commits intoPowerShell:mainfrom
SteveL-MSFT merged 7 commits intoPowerShell:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enhances the WindowsUpdate resource to detect when multiple updates match search criteria, adds restart requirement metadata in the output, and makes all text strings localizable using the rust-i18n framework.
Changes:
- Added error detection when a title matches multiple updates for get and set operations
- Implemented
_restartRequiredmetadata in set operation output when installed updates require a reboot - Migrated all error messages and user-facing strings to localized versions using rust-i18n
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| resources/WindowsUpdate/src/windows_update/types.rs | Added optional metadata field to UpdateList struct for storing restart requirements |
| resources/WindowsUpdate/src/windows_update/set.rs | Added reboot detection logic, multiple update matching validation, and localized error messages |
| resources/WindowsUpdate/src/windows_update/get.rs | Added multiple update matching validation and localized error messages |
| resources/WindowsUpdate/src/windows_update/export.rs | Updated error messages to use localization and initialized metadata field |
| resources/WindowsUpdate/src/main.rs | Initialized rust-i18n framework and localized error messages |
| resources/WindowsUpdate/locales/en-us.toml | Added all localized strings for error messages and user-facing text |
| resources/WindowsUpdate/Cargo.toml | Added rust-i18n dependency |
| Cargo.lock | Updated lock file with rust-i18n dependency |
Comments suppressed due to low confidence (1)
resources/WindowsUpdate/Cargo.toml:17
- The Cargo.toml is missing package.metadata.i18n configuration that other resources using rust-i18n include. Consider adding the following section to properly configure the i18n system:
[package.metadata.i18n]
available-locales = ["en-us"]
default-locale = "en-us"
load-path = "locales"
This ensures consistent configuration across resources and may be required for proper localization loading.
[dependencies]
rust-i18n = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
[target.'cfg(windows)'.dependencies]
windows = { workspace = true }
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
tgauth
approved these changes
Jan 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Summary
titlematches more than one update forgetandset_restartRequiredforsetif needed